package com.hombio.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hombio.service.MedicineMSService;

import cn.edu.scau.cmi.hombio.dao.SupplierDAO;
import cn.edu.scau.cmi.hombio.domain.Supplier;
import cn.edu.scau.cmi.hombio.service.SupplierService;

@Controller
public class SupplierController {
	@Autowired
	SupplierService supplierService;
	@Autowired
	SupplierDAO supplierDAO;
	@Autowired
	MedicineMSService medicineMSService;
	@RequestMapping("/s/list")
	public String listSupplier(){
		return "supplier-list";
	}
	
	@RequestMapping("/s/batch/delete")
	@ResponseBody
	public void batchDeleteSuppliers(String ids){
		medicineMSService.batchDeleteSuppliers(ids);
	}
	
	@RequestMapping("/s/add")
	public String goAddSupplier(){
		return "supplier-add";
	}
	
	@RequestMapping("/s/addSupplier")
	@ResponseBody
	public void addSupplier(@RequestBody Supplier supplier){
		medicineMSService.addSupplier(supplier);
	}
}
